﻿using System;
using fastCSharp;

namespace diantou.web.management
{
    /// <summary>
    /// 比赛调用
    /// </summary>
    [fastCSharp.code.cSharp.webCall(IsPool = true)]
    class contest : fastCSharp.code.cSharp.webCall.call<contest>
    {
        /// <summary>
        /// 测试数据ZIP文件
        /// </summary>
        /// <param name="contestId"></param>
        [fastCSharp.code.cSharp.webCall]
        public void RegisterUserId(int contestId)
        {
            diantou.dataAccess.user user = web.pub.GetSessionUser(this);
            if (user.Permission == dataModel.user.permission.Admin)
            {
                int[] ids = diantou.dataAccess.tcpCall.contest.getRegisterUserId(contestId);
                createResponse();
                try
                {
                    Response.SetTextContentType();
                    response(ids.joinString(','));
                }
                finally { responseEnd(); }
            }
            else NotFound404();
        }
    }
}